﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Barbar.Colonization.Model;
using Barbar.Colonization.Model.Script.TileCommands;

namespace Barbar.Colonization.WorldEditor {
  public partial class FormMain : Form {
    public FormMain() {
      InitializeComponent();
      terrainToolStrip.SetRuleSet(Program.Game.RuleSet);
      worldRenderer.SetWorld(Program.Game.World);
    }

    private void WorldRenderer_OnTileClick(Tile tile) {
      if (terrainToolStrip.ActiveTileType != null) {
        SetTileType command = new SetTileType(tile, terrainToolStrip.ActiveTileType);
        command.Execute();
        worldRenderer.Refresh();
      }
    }
  }
}
